//
//  HomeViewController.swift
//  xmly
//
//  Created by 刘文超 on 2019/12/27.
//  Copyright © 2019 刘文超. All rights reserved.
//

import UIKit
import DNSPageView
class HomeViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.white
        

        setUpPageStyle()
    }
    

    func setUpPageStyle() {
        
        let pageStyle = PageStyle.init()
        pageStyle.isShowBottomLine = true
        pageStyle.bottomLineColor = MainColor
        pageStyle.isTitleViewScrollEnabled = false
        pageStyle.isTitleScaleEnabled = true
        pageStyle.bottomLineHeight = 2
        pageStyle.titleColor = UIColor.gray
        pageStyle.titleSelectedColor = MainColor
        pageStyle.isShowCoverView = false
        
        let titles = ["推荐","分类","VIP","直播","广播"]
        let viewControlles:[UIViewController] = [TuijianViewController(),SoreViewController(),VIPViewController(),liveViewController(),noticViewController()]
        
        for vc in viewControlles {
            self.addChild(vc)
        }
        
        let pageView = PageView.init(frame: CGRect.init(x: 0, y: SafeAreaTopHeight, width: ScreenWidth, height: ScreenHeight-SafeAreaTopHeight-KTabBarHeight), style: pageStyle, titles: titles, childViewControllers: viewControlles)
        self.view.addSubview(pageView)
    }
}
